#!/bin/bash

function getProviderSO()
{
    PegasusLib="/usr/lib/Pegasus/providers"
    SFCBLib="/usr/lib/cmpi"
    SODirectory=""

    if [ -d "$PegasusLib" ]
    then
        SODirectory="$PegasusLib"
    elif [ -d "$SFCBLib" ]
    then
        SODirectory="$SFCBLib"
    fi
    
    ls $SODirectory/*.so | awk -F'/' '($NF ~ /^lib.*Provider.so$/){ gsub( /Provider.so$/, "", $NF); gsub( /^lib/, "", $NF ); print $NF }'
}

getProviderSO


